home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / datatypes / picturedt-v43 / install < prev    next >
Encoding:
Text File  |  1996-07-16  |  13.5 KB  |  346 lines

  1. ;********************************************************************************
  2. ;    __  __ __      ____      ____           __           __                 
  3. ;   / / / // /__   /___ \    / __ \        _/ /_        _/ /_               
  4. ;  / / / // // /_   __/ /   / / / /______ /  __/______ /  __/__  __ ______ ______
  5. ; / / / //__  __/  /_  /   / / / // __  / / /  / __  / / /   \ \/ // __  // ____/
  6. ;/ /_/ /   / /   ___/ /   / /_/ // __  / / /_ / __  / / /_    \  // /_/ // __/_
  7. ;\____/   /_/   /____/   /_____//_/ /_/ /___//_/ /_/ /___/    / // ____//_____/
  8. ;                                                            /_// /    
  9. ; !!!! BETA !!!!                                               /_/ 
  10. ; $VER: V43DT_Installer 0.98 (June-27-1996)
  11. ; Installer by Robert C. Reiswig ©1995, 1996
  12. ;
  13. ; If you wish to use any part of this installer you must ask. Changes,
  14. ; suggestions or problems: rcr@netcom.com
  15. ;--------------------------------------------------------------------------------
  16. ;
  17. ;********************************************************************************
  18. (if (= @user-level 0) (set @user-level 1))
  19. (set whereback "SYS:Storage")
  20. (set dtdest (tackon whereback "Datatypes"))
  21. (set cksum 0)
  22. (set ncg 0)
  23. (set cybergfx 0)
  24.  
  25. ;********************************************************************************
  26. ; Read Needed System information
  27. ;********************************************************************************
  28. (set lan 1)
  29. (if (> (exists ("env:Language")) 0)
  30.   (if (= "deutsch" (getenv "Language")) (set lan 0) )
  31. )
  32.  
  33. ;********************************************************************************
  34. ;English Information
  35. ;********************************************************************************
  36. (set #whereDTs "In what directory are the V43 Datatypes located? (Not the 'Datatypes' dir itself, 1 level up, ie 'Classes'.) If they aren't installed, select where you wish to install them. (Default: 'SYS:classes'.)")
  37. (set #wherelibs "Where are your CyberGraphX libraries located? If they aren't installed, select where you wish to install them.")
  38. (set #dtdirnotfound "\nThe 'Datatypes' directory was not found. Please select where you have the V43 24bit 'Datatypes' directory located. Do not select the 'Datatypes' directory itself, but one directory level up. If you have the datatypes in 'SYS:classes/datatypes' you would pick 'SYS:classes'.\n\n'datatypes' directory not found in:\n\n") 
  39. (set #cybergfx? "\nWhat type of system are you installing the\nV43 24Bit Datatypes on?\n")
  40. (set #whereback "Where would you like to BackUp the Datatypes? If a directory Called 'Datatypes' is not there one will be created. (Default is 'SYS:Storage')")
  41. (set #whattodo "\nWould you like to backup the Datatypes Currently installed on your system that will be updated?\n")
  42. (set #backupdts " BackUp Current Datatypes")
  43. (set #foundcybergfxlib "\nYou had selected that you were installing the V43 Datatype on a OCS/ECS/AGA system.\n\nThe installer has found 'libs:cybergraphics.library'.\n\nOn OCS/ECS/AGA systems you only need to have 'cyberncg.library' installed.\n\nWould you like to remove 'libs:cybergraphics.library'?")
  44. (set #foundcyberncglib "\nYou had selected that you were installing the V43 Datatype on a CyberGraphX system.\n\nThe installer has found 'libs:cyberncg.library'.\n\nOn CyberGraphX systems you only need to have 'cybergraphics.library' installed.\n\nWould you like to remove 'libs:cyberncg.library'?")
  45. (set #backup1 "\nThe Datatypes were Backed-up to:\n")
  46. (set #backup2 "The files that were backed-up into the 'Classes' & 'libs' directories will have <ver.rev> appended to the file name.\n\nThe 'Devs:' files that were backed-up will have the <checksum> of the file appended to the file name.")
  47. (set #foundjpeg "\nThe installer has found that you have a 'JPEG.datatype' installed.  This will create a conflict with the 'JFIF.datatype' that the V43 picture.datatype uses for decoding JPEG pictures.\n\n Is it ok to move the JPEG.datatype to:\n\n")
  48. (set #Skip "Skip")
  49. (set #Delete "Delete")
  50. (set #movejpeg "Move JPEG DT")
  51.  
  52. ;********************************************************************************
  53. ; German Information
  54. ;********************************************************************************
  55. (if (= LAN 0)
  56. (
  57. (set #movejpeg "Verschiebe JPEG DT")
  58. )
  59. )
  60.  
  61. ;********************************************************************************
  62. ; Ask If installing on CyberGraphX system.
  63. ;********************************************************************************
  64. (if (> (exists ("libs:cybergraphics.library")) 0) (set cybergfx 1) )
  65.  
  66. (set cybergfx (askchoice (choices "OCS/ECS/AGA" "CyberGraphX"
  67.                      (prompt #cybergfx?)
  68.                      (help   #cybergfx?)
  69.                        (default cybergfx)
  70.                      )
  71.               )
  72. )
  73.  
  74. ;********************************************************************************
  75. ; Ask Where the Current DTs are and check for Datatypes dir.
  76. ;********************************************************************************
  77. (set whereDTs "SYS:Classes")
  78.  
  79. (procedure getdir
  80.   (set whereDTs  (askdir (prompt #whereDTs)
  81.                          (help   #whereDTs)
  82.                          (default whereDTs) 
  83.              )
  84.   )
  85. )
  86.  
  87. (getdir)
  88.  
  89. (while (= (exists (tackon whereDTs "Datatypes")) 0) 
  90.   (
  91.     (message (cat #dtdirnotfound "'" whereDTs "'"))
  92.     (getdir)   
  93.   )
  94. )
  95.  
  96. ;*******************************************************************
  97. ;  ASK where cybergfx libs are
  98. ;*******************************************************************
  99. (set wherelibs   (askdir (prompt #wherelibs)
  100.              (help   #wherelibs)
  101.                   (default "SYS:Libs")
  102.          )
  103. )
  104.  
  105. ;********************************************************************************
  106. ; Ask to Backup the Curreny DTs
  107. ;********************************************************************************
  108. (set ja (askoptions   (choices #backupdts)
  109.                        (prompt #whattodo)
  110.                       (help   #whattodo)
  111.                          (default 1)
  112.     )
  113. )
  114.  
  115. ;********************************************************************************
  116. ; If Backup, ask where and make dirs
  117. ;********************************************************************************
  118. (if (= ja 1)
  119.  (
  120.   (set whereback (askdir (prompt #whereback)
  121.                          (help   #whereback)
  122.                          (default whereback) 
  123.              )
  124.   )
  125.  
  126.   (set dtdest (tackon whereback "Datatypes"))
  127.   (if (< (exists dtdest) 2)  (makedir dtdest (infos)) )
  128.   (if (< (exists (tackon dtdest "classes")) 2)  (makedir (tackon dtdest "classes") (infos)) )
  129.   (if (< (exists (tackon dtdest "classes/codecs")) 2)  (makedir (tackon dtdest "classes/codecs") (infos)) )
  130.   (if (< (exists (tackon dtdest "classes/datatypes")) 2)  (makedir (tackon dtdest "classes/datatypes") (infos)) ) 
  131.   (if (< (exists (tackon dtdest "devs")) 2)  (makedir (tackon dtdest "devs") (infos)) )
  132.   (if (< (exists (tackon dtdest "devs/datatypes")) 2)  (makedir (tackon dtdest "devs/datatypes") (infos)) ) 
  133.   (if (< (exists (tackon dtdest "libs")) 2)  (makedir (tackon dtdest "libs") (infos)) )
  134.  
  135.  )
  136. )
  137.  
  138. (set @default-dest (tackon whereback "Datatypes"))
  139.  
  140. ;********************************************************************************
  141. ; Backup Procedure 
  142. ;******************************************************************************** 
  143. (procedure backup
  144.  (if (> (exists (tackon WHERE @each-name)) 0)
  145.   (
  146.    (set vernum1 (getversion (tackon WHERE @each-name)) )
  147.    (set ver1 (/ vernum1 65536))
  148.    (set rev1 (- vernum1 (* ver1 65536) ) )
  149.    (set verrev (cat ver1 "." rev1))
  150.  
  151.    (if (= cksum 1)
  152.      (
  153.        ;(working "working")
  154.        (set sum (getsum (tackon WHERE @each-name) ) ) 
  155.        (if (< sum 0) (set sum (* sum -1)) )
  156.        (set verrev sum)
  157.      )
  158.    )
  159.  
  160.    (set file-error (copyfiles (source (tackon WHERE @each-name)
  161.                                       (dest TO)
  162.                                       (newname (cat @each-name "." verrev))
  163.                                       (infos)
  164.                                       (optional "nofail")
  165.                               )              
  166.                    )   
  167.    )
  168.  
  169.   )
  170.  )
  171. )
  172.  
  173. ;********************************************************************************
  174. ; Check for devs:datatypes/gif.datatype 
  175. ;******************************************************************************** 
  176. (if (exists "devs:datatypes/jpeg") 
  177.  (
  178.    (set jpeg (askbool (prompt (cat #foundjpeg (tackon whereback "Datatypes")) )
  179.                (help   (cat #foundjpeg (tackon whereback "Datatypes")) )
  180.                       (choices #movejpeg #Skip)
  181.          )
  182.    )
  183.  
  184.    (if (= jpeg 1) 
  185.     (
  186.       (set dtdest (tackon whereback "Datatypes"))
  187.       (if (< (exists (tackon dtdest "classes")) 2)  (makedir (tackon dtdest "classes") (infos)) )
  188.       (if (< (exists (tackon dtdest "classes/datatypes")) 2)  (makedir (tackon dtdest "classes/datatypes") (infos)) ) 
  189.       (if (< (exists (tackon dtdest "devs")) 2)  (makedir (tackon dtdest "devs") (infos)) )
  190.       (if (< (exists (tackon dtdest "devs/datatypes")) 2)  (makedir (tackon dtdest "devs/datatypes") (infos)) ) 
  191.      
  192.       (set @each-name "jpeg")
  193.       (set WHERE "devs:datatypes")  (set TO (tackon dtdest "devs/datatypes"))  
  194.       (set cksum 1) (backup) (set cksum 0) 
  195.  
  196.       (delete "devs:datatypes/jpeg")
  197.       (delete "devs:datatypes/jpeg.info") 
  198.  
  199.     )  
  200.    )
  201.  
  202.  )
  203. )
  204.  
  205. ;********************************************************************************
  206. ; Look in Archive, if the File to be copied over is already there & it is ok to 
  207. ; back-up.. then Back-up file with <filename>.<ver.rev> OR <filename>.<checksum>
  208. ;******************************************************************************** 
  209.  (foreach "/jpeg_cdc/classes" "#?.class"
  210.   (
  211.     (set WHERE whereDTs)  (set TO (tackon dtdest "classes")) 
  212.     (if (= ja 1) (backup) )
  213.     (copylib (source (tackon "/jpeg_cdc/classes" @each-name)) (dest WHERE) (optional "nofail") (infos) ) 
  214.   )
  215.  )
  216.  
  217.  (foreach "/jpeg_cdc/classes/codecs" "#?.codec"
  218.   ( 
  219.     (set WHERE (tackon whereDTs "codecs"))  (set TO (tackon dtdest "classes/codecs"))  
  220.     (if (= ja 1) (backup) )
  221.     (copylib (source (tackon "/jpeg_cdc/classes/codecs" @each-name)) (dest WHERE) (optional "nofail") (infos) ) 
  222.   )
  223.  )
  224.  
  225.  (foreach "classes/datatypes" "#?.datatype"
  226.   ( 
  227.     (set WHERE (tackon whereDTs "datatypes"))  (set TO (tackon dtdest "classes/datatypes")) 
  228.     (if (= ja 1) (backup) ) 
  229.     (copylib (source (tackon "classes/datatypes" @each-name)) (dest WHERE) (optional "nofail") (infos) ) 
  230.   )
  231.  )
  232.  
  233.  (foreach "devs/datatypes" "~(#?.info)"
  234.   ( 
  235.     (set WHERE "devs:datatypes")  (set TO (tackon dtdest "devs/datatypes"))  
  236.     (set cksum 1)    (if (= ja 1) (backup) )    (set cksum 0) 
  237.     (copyfiles (source (tackon "devs/datatypes" @each-name)) (dest WHERE) (optional "nofail") (infos) ) 
  238.   )
  239.  )
  240.  
  241.  
  242.  (foreach "/jpeg_cdc/libs" "#?.library"
  243.   ( 
  244.     (set WHERE wherelibs)  (set TO (tackon dtdest "libs")) 
  245.     (if (= ja 1) (backup) )
  246.     (copylib (source (tackon "/jpeg_cdc/libs" @each-name)) (dest WHERE) (optional "nofail") (infos) ) 
  247.   )
  248.  )
  249.  
  250.  
  251.  
  252.  
  253. (if (= cybergfx 0)
  254.  (
  255.   (set @each-name "cyberncg.library")
  256.   (set WHERE wherelibs)  (set TO (tackon dtdest "libs")) 
  257.   (if (= ja 1) (backup) )
  258.   (copylib (source (tackon "libs" @each-name)) (dest WHERE) (optional "nofail") (infos) ) 
  259.  
  260.   (if (> (exists ("libs:cybergraphics.library")) 0)
  261.     (
  262.      (set found (askbool (prompt #foundcybergfxlib)
  263.                          (help   #foundcybergfxlib)
  264.                          (choices #Delete #Skip)
  265.             )
  266.      )
  267.      (if (= found 1) (delete "libs:cybergraphics.library") )  
  268.     ) 
  269.   )
  270.  )
  271.  
  272.  
  273.  (
  274.   (set @each-name "cybergraphics.library")
  275.   (set WHERE wherelibs)  (set TO (tackon dtdest "libs")) 
  276.   (if (= ja 1) (backup) )
  277.   (copylib (source (tackon "libs" @each-name)) (dest WHERE) (optional "nofail") (infos) ) 
  278.  
  279.   (if (> (exists ("libs:cyberncg.library")) 0)
  280.     (
  281.      (set found (askbool (prompt #foundcyberncglib)
  282.                          (help   #foundcyberncglib)
  283.                          (choices #Delete #Skip)
  284.             )
  285.      )
  286.      (if (= found 1) (delete "libs:cyberncg.library") )  
  287.     ) 
  288.   )
  289.  )
  290.  
  291. )
  292.  
  293. ;********************************************************************************
  294. ;  Tools to install, ie prefs 
  295. ;********************************************************************************
  296. (set #tools "\nWhat V43 Datatype Tools do you wish to install?\n")
  297. (set #cyberprefs " PCDT - Prefs for CyberGraphX Datatype")
  298. (set #Where "Where do you wish to install ")
  299. (set #wheredtprefs "PCDT? If there is a copy already there a backup of it will be created!")
  300.  
  301. (set ToDo1      (askoptions (choices #cyberprefs)
  302.                 (prompt #tools)
  303.                 (help #tools)
  304.                 (default 1)
  305.         )
  306. )
  307.  
  308. (if (IN ToDo1 0)
  309.   (
  310.     (set CyberDrawer (askdir (prompt #Where #wheredtprefs)
  311.                              (help   #Where #wheredtprefs)
  312.                  (default "SYS:Prefs")
  313.                      )
  314.     )
  315.  
  316.     (if (> (exists (tackon CyberDrawer "PCDT") ) 0)
  317.       (
  318.         (set vernum1 (getversion (tackon CyberDrawer "PCDT")))
  319.         (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  320.  
  321.         (copyfiles (source (tackon CyberDrawer "PCDT"))
  322.                            (dest CyberDrawer) (infos)
  323.                            (newname (cat "PCDT" ver1 "." rev1))
  324.         )
  325.  
  326.       )
  327.     )
  328.  
  329.     (copyfiles (source "Prefs/PCDT")  (dest CyberDrawer) (infos) (optional "force" "askuser" "nofail"))
  330.     (set @each-name "gtlayout.library")
  331.     (set WHERE wherelibs)  (set TO (tackon dtdest "libs")) 
  332.     (if (= ja 1) (backup) )
  333.     (copylib (source (tackon "libs" @each-name)) (dest WHERE) (optional "nofail") (infos) )    
  334.  
  335.  
  336.   )
  337. )
  338.  
  339.  
  340. ;********************************************************************************
  341. ; END  
  342. ;********************************************************************************
  343. (if (= ja 1)
  344.  (message (cat #backup1 "'" (tackon whereback "Datatypes") "'\n\n" #backup2)) 
  345. )
  346.